package com.x.erp.service;

import com.x.erp.dao.CarMappingThirdpartyDao;
import com.x.erp.thirdparty.CarMappingThirdparty;
import com.x.framework.exception.BusinessException;
import com.x.framework.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CarMappingThirdpartyService extends BaseService{
	
	@Autowired
	private CarMappingThirdpartyDao carMappingThirdpartyDao;
	
	/**
	 * 获取第三方车源车辆id
	 * @param carMappingThirdparty
	 * @return
	 */
	public List<CarMappingThirdparty> selectCarMappingThirdpartList(CarMappingThirdparty carMappingThirdparty){
		try {
			return carMappingThirdpartyDao.selectCarMappingThirdpartyList(carMappingThirdparty);
		} catch (Exception e) {
			throw new BusinessException("查询第三方车辆映射数据失败！", e);
		}
	}
	
	/**
	 * 新增第三方车源车辆id
	 * @param carMappingFirstCar
	 * @return
	 */
	public CarMappingThirdparty insertCarMappingThirdpart(CarMappingThirdparty carMappingFirstCar){
		try {
			return this.insert(carMappingFirstCar);
		} catch (Exception e) {
			throw new BusinessException("新增第三方车辆映射数据失败！", e);
		}
	}

}
